<!--
 * @Description  : 借阅单
 * @Author       : zhao
 * @Date         : 2022-06-28 11:16:19
 * @LastEditors  : zhao
 * @LastEditTime : 2023-02-02 13:51:58
-->

<!--  -->
<template>
    <div class="BorrowForm">
        <div class="BorrowForm_content" style="">
            <div class="pwd_top">
                <span>借阅单</span>
            </div>
            <!-- <div class="title"><zPageHeader :url="'/SpatialRetrieval'" :content="'借阅单列表'" /></div> -->
            <ztable :searchType="searchType" :tableHeader="tableHeader" :tableData="tableData" />
        </div>
    </div>
</template>

<script>
import ztable from "@/components/zTable"
import zPageHeader from "@/components/zPageHeader"
import BFData from "./BorrowForm"
export default {
    name: "BorrowForm",
    data() {
        return {
            searchType: BFData.searchType,
            tableHeader: BFData.tableHeader,
            tableData: [],
        }
    },

    components: { ztable, zPageHeader },

    computed: {},

    mounted() {
        this.$store.state.table.searchData.pageSize = 10
        this.$store.state.table.searchData.pageIndex = 1
        this.getBorrowingForm()
        this.$store.state.map.mapList = []
    },

    methods: {
        async getBorrowingForm() {
            this.$store.state.table.url = "borrowForm/getBorrowingForm"

            const { data, code, count } = await this.$store.dispatch("borrowForm/getBorrowingForm", {
                pageIndex: 1,
                pageSize: 10,
            })
            data.map((e) => {
                if (e.state == "1") e.state = "审核中"
                if (e.state == "2") e.state = "已驳回"
                if (e.state == "3") e.state = "已通过"
                if (e.state == "4") e.state = "已完成"
                if (e.state == "5") e.state = "已过期"
                if (e.state == "6") e.state = "已撤销"
            })

            this.$store.state.table.PaginationData.total = count
            this.$store.state.table.tableData = data || []
        },
    },
}
</script>
<style lang='scss' scoped>
.BorrowForm {
    padding: var(--main-padding);

    .BorrowForm_content {
        padding: 20px;
        min-height: $height_full;
        background-color: #fff;
    }

    .title {
        font-size: 24px;
        font-weight: 550;
    }

    .pwd_top {
        padding: 0 0px;
        display: flex;
        justify-content: flex-start;
        align-items: center;
        border-bottom: 1px solid #0076a8;

        span {
            text-decoration: none;
            color: #0076a8;
            font-size: 0.37rem;
            font-family: "微软雅黑";
            padding: 10px 0;
        }
    }
}
</style>